home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group99a.txt
/
000084_icon-group-sender _Mon Apr 5 12:24:02 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
3KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA29776
for icon-group-addresses; Mon, 5 Apr 1999 12:22:27 -0700 (MST)
Message-Id: <199904051922.MAA29776@baskerville.CS.Arizona.EDU>
From: Todd Proebsting <toddpro@microsoft.com>
To: "'Ehud Lamm'" <mslamm@mscc.huji.ac.il>, icon-group@optima.CS.Arizona.EDU
Subject: RE: How programs fail
Date: Mon, 5 Apr 1999 09:42:11 -0700
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
I like Icon's model of what is failure and what is an error, although I,
too, have been nailed by a failing expression that in a particular context
is fatal to my application. To find such, I use the following pattern:
f := open(filename) | runerr(500, filename)
runerr(500) is for "Programmer-Specified Errors" and reports "program
malfunction", which is precisely what you want in this circumstance.
Getting the stack trace is useful.
Todd
-----Original Message-----
From: Ehud Lamm [mailto:mslamm@mscc.huji.ac.il]
Sent: Monday, April 05, 1999 5:13 AM
To: icon-group@optima.CS.Arizona.EDU
Subject: How programs fail
Had a funny problem today, which may give a lesson to us all.
I had some files that needed to be hacked a bit (a chunk was to be removed
from each of them), and I decided to use Icon.
I am using Win95, but my Icon version is quite old - 8.10 I think.
It took me a few minutes to find filter.icn in the IPL, change it to my
needs and test to see it works. All was fine.
Then I tried to run it on my files, but it didn't work. No error messages,
just that the output files didn't get created, and the input files, which
weren't supposed to change were suddenly empty.
It occured to me that Win95 allows long file names, so I changed my
directory names to one word shorter than 8 letters. However things still
didn't work.
I tried moving the files arround, to my Icon direcotry, so no path will be
used. No improvement.
It tried &trace - didn't give a clue.
Only thing I found out was that the read() from the input file fails.
However, I didn't see any reason for this.
I almost decided to think of another solution.
And than it hit me...
The input files were named *.htm, and I was so happy I found a way to get
meaningful output names with little effort - just call them *.html. This
means my code simply appended an "l".
However this made the extension longer than 3 letters... Took me an hour
to notice. A minute to fix. Than it worked.
Aside from feeling stupid, I think it would have been nice if Icon would
have yeeld saying that the output file name I gave it was bad. I am not
sure if this can be done in any nice way, but it does show that software
must be maintained, and that the dictum "if it ain't broke don't fix it"
is wrong when applied to software. Other software will be upgraded and
will cause yours to fail.
It is also quite sad that instead of producing an error, when the open was
done - the code continued to run and corrupted the input files. Even
sadder is the fact that I had no tools to help analyze the problem. My
Icon version is very lacking in this regard.
I seem to recall seeing that Ralph Griswold is teaching Software Eng. Well
I may use this story on my SE students...
Ehud Lamm mslamm@pluto.mscc.huji.ac.il